<template>
  <a-drawer
    :title="title"
    :width="width"
    placement="right"
    :closable="false"
    @close="close"
    :visible="visible">
  
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">

        <a-form-item label="采购方总部编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'purchaserHqCode', validatorRules.purchaserHqCode, {}]" :triggerChange="true" placeholder="请选择采购方总部" dictCode="purchaserHqCode"/>
        </a-form-item>
        <a-form-item label="供应商名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag @change="handleInput" v-decorator="[ 'supplierCode', validatorRules.supplierCode, {}]" :triggerChange="true" placeholder="请选择供应商名称" dictCode="kggSupplierCode" />
          <a-input v-model="model.supplierName" type="hidden"/>
        </a-form-item>
        <a-form-item label="供应商工单编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="[ 'supplierWorkNo', validatorRules.supplierWorkNo, {}]" placeholder="请输入供应商工单编号"></a-input>
        </a-form-item>
        <a-form-item label="采集规范版本号" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="[ 'standardVersion', validatorRules.standardVersion, {}]" disabled></a-input>
        </a-form-item>
        <a-form-item label="规格型号编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'modelCode', validatorRules.modelCode, {}]" :triggerChange="true" placeholder="请选择规格型号编码" dictCode="kggModelCode"/>
        </a-form-item>
        <a-form-item label="物资品类类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'categoryType', validatorRules.categoryType]" :triggerChange="true" placeholder="请选择物资品类类型" dictCode="kggCategoryType"/>
        </a-form-item>
        <a-form-item label="采集时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-date placeholder="请选择采集时间" showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss" v-decorator="[ 'checkTime', validatorRules.checkTime]" :trigger-change="true" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="入数采中心时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-date placeholder="请选择入数采中心时间" showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss" v-decorator="[ 'putCenterTime', validatorRules.putCenterTime]" :trigger-change="true" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="工序" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="[ 'pdCode', validatorRules.pdCode]" placeholder="请输入工序"></a-input>
        </a-form-item>
        <a-form-item label="感知过程" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="[ 'processType', validatorRules.processType]" placeholder="请输入感知过程"></a-input>
        </a-form-item>
        <a-form-item label="相对地耐压额定值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'pressureValueUn', validatorRules.pressureValueUn]" placeholder="请输入相对地耐压额定值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="相对地耐压值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'pressureValue', validatorRules.pressureValue]" placeholder="请输入相对地耐压值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="真空断口耐压额定值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'vacuumVoltageUn', validatorRules.vacuumVoltageUn]" placeholder="请输入真空断口耐压额定值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="真空断口耐压值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'vacuumVoltage', validatorRules.vacuumVoltage]" placeholder="请输入真空断口耐压值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="相间耐压额定值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'phaseVoltageUn', validatorRules.phaseVoltageUn]" placeholder="请输入相间耐压额定值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="相间耐压值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'phaseVoltage', validatorRules.phaseVoltage]" placeholder="请输入相间耐压值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="耐压持续额定时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'pressureTimeUn', validatorRules.pressureTimeUn]" placeholder="请输入耐压持续额定时间" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="耐压持续时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'pressureTime', validatorRules.pressureTime]" placeholder="请输入耐压持续时间" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="额定电流" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'ratedCurrent', validatorRules.ratedCurrent]" placeholder="请输入额定电流" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="额定回路电阻值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'loopResistanceUn', validatorRules.loopResistanceUn]" placeholder="请输入额定回路电阻值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="A相回路电阻值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'loopResistanceA', validatorRules.loopResistanceA]" placeholder="请输入A相回路电阻值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="B相回路电阻值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'loopResistanceB', validatorRules.loopResistanceB]" placeholder="请输入B相回路电阻值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="C相回路电阻值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'loopResistanceC', validatorRules.loopResistanceC]" placeholder="请输入C相回路电阻值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="人力分合操作5次，可靠动作" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'perReliableOper', validatorRules.perReliableOper, {}]" :triggerChange="true" placeholder="请选择人力分合操作5次，可靠动作" dictCode="isTrue"/>
        </a-form-item>
        <a-form-item label="储能电机85%和110%操作电压，储能可靠动作" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'reliableStorageOper', validatorRules.reliableStorageOper, {}]" :triggerChange="true" placeholder="请选择储能电机85%和110%操作电压，储能可靠动作" dictCode="isTrue"/>
        </a-form-item>
        <a-form-item label="等于或低于30% 额定合闸电压时，操作5次，可靠不动作" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'nomVolReliableOper', validatorRules.nomVolReliableOper, {}]" :triggerChange="true" placeholder="请选择等于或低于30% 额定合闸电压时，操作5次，可靠不动作" dictCode="isTrue"/>
        </a-form-item>
        <a-form-item label="85%~110%额定合闸电压（直流）范围，操作5次，可靠合闸" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'nomACReliableSwitch', validatorRules.nomACReliableSwitch, {}]" :triggerChange="true" placeholder="请选择85%~110%额定合闸电压（直流）范围，操作5次，可靠合闸" dictCode="isTrue"/>
        </a-form-item>
        <a-form-item label="65%~110%额定分闸电压（直流）范围，操作5次，可靠分闸" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'nomDCReliableSwitch', validatorRules.nomDCReliableSwitch, {}]" :triggerChange="true" placeholder="请选择65%~110%额定分闸电压（直流）范围，操作5次，可靠分闸" dictCode="isTrue"/>
        </a-form-item>
        <a-form-item label="分闸电源低于额定30%，操作5次可靠不动作" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'breakReliableNoOper', validatorRules.breakReliableNoOper, {}]" :triggerChange="true" placeholder="请选择分闸电源低于额定30%，操作5次可靠不动作" dictCode="isTrue"/>
        </a-form-item>
        <a-form-item label="额定操作电压下，分合操作5次，均可靠动作" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'breakNomVolReliableOper', validatorRules.breakNomVolReliableOper, {}]" :triggerChange="true" placeholder="请选择额定操作电压下，分合操作5次，均可靠动作" dictCode="isTrue"/>
        </a-form-item>
        <a-form-item label="额定操作电压“分-0.3-合分”，可靠动作" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag v-decorator="[ 'breakVolReliableOper', validatorRules.breakVolReliableOper, {}]" :triggerChange="true" placeholder="请选择额定操作电压“分-0.3-合分”，可靠动作" dictCode="isTrue"/>
        </a-form-item>
        <a-form-item label="分闸时间额定上限值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'breakTimeMax', validatorRules.breakTimeMax]" placeholder="请输入分闸时间额定上限值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="分闸时间额定下限值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'breakTimeMin', validatorRules.breakTimeMin]" placeholder="请输入分闸时间额定下限值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="A相分闸时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'breakTimeA', validatorRules.breakTimeA]" placeholder="请输入A相分闸时间" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="B相分闸时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'breakTimeB', validatorRules.breakTimeB]" placeholder="请输入B相分闸时间" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="C相分闸时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'breakTimeC', validatorRules.breakTimeC]" placeholder="请输入C相分闸时间" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="合闸时间额定上限值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'closeTimeMax', validatorRules.closeTimeMax]" placeholder="请输入合闸时间额定上限值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="合闸时间额定下限值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'closeTimeMin', validatorRules.closeTimeMin]" placeholder="请输入合闸时间额定下限值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="A相合闸时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'closeTimeA', validatorRules.closeTimeA]" placeholder="请输入A相合闸时间" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="B相合闸时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'closeTimeB', validatorRules.closeTimeB]" placeholder="请输入B相合闸时间" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="C相合闸时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'closeTimeC', validatorRules.closeTimeC]" placeholder="请输入C相合闸时间" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="合闸不同期额定值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'closeNotSameTimeUn', validatorRules.closeNotSameTimeUn]" placeholder="请输入合闸不同期额定值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="合闸不同期" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'closeNotSameTime', validatorRules.closeNotSameTime]" placeholder="请输入合闸不同期" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="分闸不同期额定值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'breakNotSameTimeUn', validatorRules.breakNotSameTimeUn]" placeholder="请输入分闸不同期额定值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="分闸不同期" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'breakNotSameTime', validatorRules.breakNotSameTime]" placeholder="请输入分闸不同期" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="合闸弹跳（真空断路器）额定值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'closeBounceTimeUn', validatorRules.closeBounceTimeUn]" placeholder="请输入合闸弹跳（真空断路器）额定值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="合闸弹跳（真空断路器）" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'closeBounceTime', validatorRules.closeBounceTime]" placeholder="请输入合闸弹跳（真空断路器）" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="分闸反弹幅值额定值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'breakOffAmplitudeUn', validatorRules.breakOffAmplitudeUn]" placeholder="请输入分闸反弹幅值额定值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="分闸反弹幅值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input-number v-decorator="[ 'breakOffAmplitude', validatorRules.breakOffAmplitude]" placeholder="请输入分闸反弹幅值" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="（断路器小车）检验报告附件文件名" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-upload
                  name="avatar"
                  :multiple="true"
                  :data="token"
                  :headers="headers"
                  :default-file-list="defaultFileList"
                  :action="'/jeecg-boot' + '/fileupload/checkResultObj'"
                  @change="handleChange"
          >
            <a-button> <a-icon type="upload" />上传图片</a-button>
          </a-upload>
          <a-input v-model="model.fileName" type="hidden"/>
          <a-input v-model="model.fileObj" type="hidden"/>
          <a-input v-decorator="[ 'ioflag', validatorRules.ioflag]" type="hidden"/>
        </a-form-item>
      </a-form>
    </a-spin>
    <a-button type="primary" @click="handleOk">确定</a-button>
    <a-button type="primary" @click="handleCancel">取消</a-button>
  </a-drawer>
</template>

<script>

  import { httpAction } from '@/api/manage'
  import pick from 'lodash.pick'
  import JDate from '@/components/jeecg/JDate'

  import {ACCESS_TOKEN} from "@/store/mutation-types"
  import Vue from 'vue'
  import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'

  export default {
    name: "EipCircuitBreakerTrolleyModal",
    components: { 
      JDate,
    },
    data () {
      return {
        form: this.$form.createForm(this),
        title:"操作",
        width:800,
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },

        confirmLoading: false,
        defaultFileList:[],
        kggSupplierCodeDictOptions:[],
        validatorRules:{
        puid:{},
        purchaserHqCode:{rules: [{ required: true, message: '请输入采购方总部编码!' }],initialValue:'SGCC'},
        supplierCode:{rules: [{ required: true, message: '请输入侧供应商编码!' }]},
        supplierName:{rules: [{ required: true, message: '请输入供应商名称!' }]},
        supplierWorkNo:{rules: [{ required: true, message: '请输入供应商工单编号!' }]},
        standardVersion: {rules: [{required: true, message: '请输入采集规范版本号!'}],initialValue:'1'},
        modelCode:{rules: [{ required: true, message: '请输入规格型号编码!' }],initialValue:'gear00001'},
        categoryType:{rules: [{ required: true, message: '请输入物资品类类型!' }],initialValue:'90001'},
        checkTime:{rules: [{ required: true, message: '请输入采集时间!' }]},
        putCenterTime:{rules: [{ required: true, message: '请输入入数采中心时间!' }]},
        pdCode:{rules: [{ required: true, message: '请输入工序!' }],initialValue:'GX000005'},
        processType:{rules: [{ required: true, message: '请输入感知过程!' }],initialValue:'1'},
        pressureValueUn:{rules: [{ required: true, message: '请输入相对地耐压额定值!' }]},
        pressureValue:{rules: [{ required: true, message: '请输入相对地耐压值!' }]},
        vacuumVoltageUn:{rules: [{ required: true, message: '请输入真空断口耐压额定值!' }]},
        vacuumVoltage:{rules: [{ required: true, message: '请输入真空断口耐压值!' }]},
        phaseVoltageUn:{rules: [{ required: true, message: '请输入相间耐压额定值!' }]},
        phaseVoltage:{rules: [{ required: true, message: '请输入相间耐压值!' }]},
        pressureTimeUn:{rules: [{ required: true, message: '请输入耐压持续额定时间!' }]},
        pressureTime:{rules: [{ required: true, message: '请输入耐压持续时间!' }]},
        ratedCurrent:{rules: [{ required: true, message: '请输入额定电流!' }]},
        loopResistanceUn:{rules: [{ required: true, message: '请输入额定回路电阻值!' }]},
        loopResistanceA:{rules: [{ required: true, message: '请输入A相回路电阻值!' }]},
        loopResistanceB:{rules: [{ required: true, message: '请输入B相回路电阻值!' }]},
        loopResistanceC:{rules: [{ required: true, message: '请输入C相回路电阻值!' }]},
        perReliableOper:{rules: [{ required: true, message: '请输入人力分合操作5次，可靠动作!' }]},
        reliableStorageOper:{rules: [{ required: true, message: '请输入储能电机85%和110%操作电压，储能可靠动作!' }]},
        nomVolReliableOper:{rules: [{ required: true, message: '请输入等于或低于30% 额定合闸电压时，操作5次，可靠不动作!' }]},
        nomACReliableSwitch:{rules: [{ required: true, message: '请输入85%~110%额定合闸电压（直流）范围，操作5次，可靠合闸!' }]},
        nomDCReliableSwitch:{rules: [{ required: true, message: '请输入65%~110%额定分闸电压（直流）范围，操作5次，可靠分闸!' }]},
        breakReliableNoOper:{rules: [{ required: true, message: '请输入分闸电源低于额定30%，操作5次可靠不动作!' }]},
        breakNomVolReliableOper:{rules: [{ required: true, message: '请输入额定操作电压下，分合操作5次，均可靠动作!' }]},
        breakVolReliableOper:{rules: [{ required: true, message: '请输入额定操作电压“分-0.3-合分”，可靠动作!' }]},
        breakTimeMax:{rules: [{ required: true, message: '请输入分闸时间额定上限值!' }]},
        breakTimeMin:{rules: [{ required: true, message: '请输入分闸时间额定下限值!' }]},
        breakTimeA:{rules: [{ required: true, message: '请输入A相分闸时间!' }]},
        breakTimeB:{rules: [{ required: true, message: '请输入B相分闸时间!' }]},
        breakTimeC:{rules: [{ required: true, message: '请输入C相分闸时间!' }]},
        closeTimeMax:{rules: [{ required: true, message: '请输入合闸时间额定上限值!' }]},
        closeTimeMin:{rules: [{ required: true, message: '请输入合闸时间额定下限值!' }]},
        closeTimeA:{rules: [{ required: true, message: '请输入A相合闸时间!' }]},
        closeTimeB:{rules: [{ required: true, message: '请输入B相合闸时间!' }]},
        closeTimeC:{rules: [{ required: true, message: '请输入C相合闸时间!' }]},
        closeNotSameTimeUn:{rules: [{ required: true, message: '请输入合闸不同期额定值!' }]},
        closeNotSameTime:{rules: [{ required: true, message: '请输入合闸不同期!' }]},
        breakNotSameTimeUn:{rules: [{ required: true, message: '请输入分闸不同期额定值!' }]},
        breakNotSameTime:{rules: [{ required: true, message: '请输入分闸不同期!' }]},
        closeBounceTimeUn:{rules: [{ required: true, message: '请输入合闸弹跳（真空断路器）额定值!' }]},
        closeBounceTime:{rules: [{ required: true, message: '请输入合闸弹跳（真空断路器）!' }]},
        breakOffAmplitudeUn:{},
        breakOffAmplitude:{rules: [{ required: true, message: '请输入分闸反弹幅值!' }]},
        fileName:{},
        fileObj:{},
        ioflag:{rules: [{ required: true, message: '请输入状态表示!' }],initialValue:'1'},
        message:{},
        remark1:{},
        remark2:{},
        remark3:{},
        remark4:{},
        remark5:{},
        },
        url: {
          add: "/eipCircuitBreakerTrolley/add",
          edit: "/eipCircuitBreakerTrolley/edit",
        }
     
      }
    },
    created () {
      const token=Vue.ls.get(ACCESS_TOKEN);
      this.headers={ authorization: 'authorization-text',"X-Access-Token":token }
    },
    methods: {
      handleInput(e){
        this.model.supplierName = filterDictText(this.kggSupplierCodeDictOptions, e);
      },
      handleChange(info) {
        if (info.file.status !== 'uploading') {
          this.model.fileName=info.file.name;
          this.model.fileObj=info.file.response;
        }
        if (info.file.status === 'done') {

          this.$message.success(`${info.file.name} file uploaded successfully`);
        } else if (info.file.status === 'error') {
          this.$message.error(`${info.file.name} file upload failed.`);
        }
      },
      add () {
        this.defaultFileList=[];
        this.edit({});
      },
      edit (record) {
        this.form.resetFields();
        this.model = Object.assign({}, record);
        this.visible = true;
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model,"puid", "purchaserHqCode", "supplierCode", "supplierName", "supplierWorkNo", "standardVersion", "modelCode", "categoryType", "checkTime", "putCenterTime", "pdCode", "processType", "pressureValueUn", "pressureValue", "vacuumVoltageUn", "vacuumVoltage", "phaseVoltageUn", "phaseVoltage", "pressureTimeUn", "pressureTime", "ratedCurrent", "loopResistanceUn", "loopResistanceA", "loopResistanceB", "loopResistanceC", "perReliableOper", "reliableStorageOper", "nomVolReliableOper", "nomACReliableSwitch", "nomDCReliableSwitch", "breakReliableNoOper", "breakNomVolReliableOper", "breakVolReliableOper", "breakTimeMax", "breakTimeMin", "breakTimeA", "breakTimeB", "breakTimeC", "closeTimeMax", "closeTimeMin", "closeTimeA", "closeTimeB", "closeTimeC", "closeNotSameTimeUn", "closeNotSameTime", "breakNotSameTimeUn", "breakNotSameTime", "closeBounceTimeUn", "closeBounceTime", "breakOffAmplitudeUn", "breakOffAmplitude", "fileName", "fileObj", "ioflag", "message", "remark1", "remark2", "remark3", "remark4", "remark5"))
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        const that = this;
        // 触发表单验证
        this.form.validateFields((err, values) => {
          if (!err) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.puid){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            let formData = Object.assign(this.model, values);
            console.log("表单提交数据",formData)
            httpAction(httpurl,formData,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
              that.close();
            })
          }
         
        })
      },
      handleCancel () {
        this.close()
      },
      popupCallback(row){
        this.form.setFieldsValue(pick(row,"puid", "purchaserHqCode", "supplierCode", "supplierName", "supplierWorkNo", "standardVersion", "modelCode", "categoryType", "checkTime", "putCenterTime", "pdCode", "processType", "pressureValueUn", "pressureValue", "vacuumVoltageUn", "vacuumVoltage", "phaseVoltageUn", "phaseVoltage", "pressureTimeUn", "pressureTime", "ratedCurrent", "loopResistanceUn", "loopResistanceA", "loopResistanceB", "loopResistanceC", "perReliableOper", "reliableStorageOper", "nomVolReliableOper", "nomACReliableSwitch", "nomDCReliableSwitch", "breakReliableNoOper", "breakNomVolReliableOper", "breakVolReliableOper", "breakTimeMax", "breakTimeMin", "breakTimeA", "breakTimeB", "breakTimeC", "closeTimeMax", "closeTimeMin", "closeTimeA", "closeTimeB", "closeTimeC", "closeNotSameTimeUn", "closeNotSameTime", "breakNotSameTimeUn", "breakNotSameTime", "closeBounceTimeUn", "closeBounceTime", "breakOffAmplitudeUn", "breakOffAmplitude", "fileName", "fileObj", "ioflag", "message", "remark1", "remark2", "remark3", "remark4", "remark5"))
      }
    },
    mounted() {
      initDictOptions('kggSupplierCode').then((res) => {
        if (res.success) {
          this.kggSupplierCodeDictOptions = res.result
        }
      });
    }
  }
</script>

<style lang="less" scoped>
/** Button按钮间距 */
  .ant-btn {
    margin-left: 30px;
    margin-bottom: 30px;
    float: right;
  }
</style>